program P5_3_NOT_WORKING;
var a:array[1..30] of integer;
    i,j:integer;
    F:boolean;
begin
randomize;
for i:=1 to 30 do a[i]:=random(29)+1;
for i:=1 to 30 do writeln(a[i]:4);
for i:=1 to 30 do
	begin
	j:=1; F:=true;
	while (j <= 30) and F do
		begin
		if i=j then inc(j);
		if a[i]=a[j] then F:=false;
		inc(j);
		end;
	if f then writeln('ans ',a[i]:6);
	end;
end.
